import '@ant-design/compatible/assets/index.css';
import { Row, Col } from 'antd';
import React from 'react';
import styles from './style.less'
import { API_URL } from '@/config/api'

const PicInfo = props => {

  const { lostItemPicArr } = props;

  // 过滤大类
  const fitlerPicCategory = (v) => {
    if (v === 1) {
      return (<span>物品相关</span>)
    } else if (v === 2) {
      return (<span>旅客相关</span>)
    } else if (v === 3) {
      return (<span>单据相关</span>)
    }
  }

   // 过滤小类
   const fitlerPicType = (v) => {
    if (v === 1) {
      return (<span>遗失物品照片</span>)
    } else if (v === 2) {
      return (<span>身份证</span>)
    } else if (v === 3) {
      return (<span>委托书</span>)
    } else if (v === 4) {
      return (<span>登机牌</span>)
    } else if (v === 5) {
      return (<span>认领单</span>)
    } else if (v === 6) {
      return (<span>上交单</span>)
    } else if (v === 7) {
      return (<span>遗失物品统计单</span>)
    } else if (v === 8) {
      return (<span>快递单</span>)
    } else if (v === 9) {
      return (<span>旅客授权签字图</span>)
    } else if (v === 10) {
      return (<span>其他</span>)
    }
  }

  return (
    <div className={styles.picInfo}>
      <Row>
        <Col span={24}>
          附件
        </Col>
      </Row>
      <div className={styles.picList}>
        {
          lostItemPicArr.map(item => (
            <div>
              <img src={API_URL + `/api/uploadAndDownload/showImg?imgUrl=` + item.imgUrl} alt="" />
              <p className={styles.picCategory}>{fitlerPicCategory(item.oneType)}</p>
              <p className={styles.picType}>{fitlerPicType(item.twoType)}</p>
            </div>
          ))
        }
      </div>
    </div>
  )
}

export default PicInfo;